Unit 1 · Lesson 9

Lossless Compression

FRQ · Warm-Up

Why Abbreviate?

This list represents several common abbreviations used in text messages: lol, ty, c u soon. Why might we use abbreviations when sending messages? What are the advantages?

FRQ · Activity Guide

Decode This Message

Work with your partner on the “Decode This Message” activity guide.

What does the message say?

Decoded

How Did You Decode It?

Decoded
Pitter_Patter_Pitter_Patter_listen_to_the_rain_Pitter_Patter_Pitter_Patter_on_the_window_pane
Encoded

Message:

Encoded message reading: black star icon, listen_to, sun burst icon (highlighted), rain_, black star icon, on, sun burst icon (highlighted), window_pane

Key:

Dictionary key: sun burst icon maps to _the_, umbrella icon maps to tter_, snowman icon maps to Pi followed by the umbrella icon, snow icon maps to Pa followed by the umbrella icon, and black star icon maps to snowman icon, snow icon, snowman icon, snow icon in sequence

How were you able to decode the message? What information did you need?

Text Compression Widget

Step 1: Practice

Navigate to Code Studio Lesson 9 Level 1. Open up the 1.9 Digital Activity Guide. Work with your partner to try to compress the text.

Driver

Runs the activity and uses the computer.

Navigator

Keeps track of the big picture and helps guide the driver to the goal.

Text Compression Widget

Make Note of Your Compression Rating

The black box has statistics. Higher compression is better. Smaller total is better.

Text Compression Widget showing a Compressed panel with highlighted repeated substrings, a Dictionary panel listing the substring being replaced, and a black statistics box reading Compressed text size 156 bytes, Dictionary size 23 bytes, Total 179 bytes, Original text size 240 bytes, Compression 25.42 percent
FRQ · Check-In

How'd It Go?

What was your compression ratio? What strategies are you using to compress your sample text? Which ones seem most successful?

🎧 A Little Help

Let's Get Some Help

Up next is a video that will help us out a bit.

Video

Aloe Blacc on Text Compression

Text Compression Widget

Back At It

Click the drop-down menu to explore other texts to compress. Look for texts you predict will be “easy” to compress and texts you predict will be “difficult”. Work with your partner to compress the easy and then the difficult texts. Fill in the Digital Activity Guide as you go.

You should swap “driver” and “navigator” roles for each text.

Wrap Up

Lossless Compression

Lossless compression: a process for reducing the number of bits needed to represent something without losing any information. This process is reversible, and all data is preserved exactly as it started.

01101100 01101111
01110011 01110011
01101100 01100101
01110011 01110011
compress
01101100 10010111
decompress
01101100 01101111
01110011 01110011
01101100 01100101
01110011 01110011